package com.lqk.java1;

/**
 * @author lqk
 * @date 2021/10/31 19:18
 */
public class ClassLoaderTest2 {
    public static void main(String[] args) {
        try {
            // 1
            ClassLoader classLoader = Class.forName("java.lang.String").getClassLoader();
            System.out.println(classLoader);
            // 2
            ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
            System.out.println(contextClassLoader);
            // 3
            ClassLoader classLoader1 = ClassLoader.getSystemClassLoader().getParent();
            System.out.println(classLoader1);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
}
